Release 10.1A: OpenEdge Development:
Java Open Clients


Passing INPUT-OUTPUT parameters

Passing an INPUT-OUTPUT parameter requires several steps to provide a value as input to an application service procedure or user-defined function, then to return a value as output using the same parameter.

To pass an INPUT parameter:

  1. Create and initialize a variable for the parameter of the correct Java data type (see the "Creating variables for parameters" section).
  2. Add the parameter to a ParamArray object (see the "Setting up a parameter array" section).
  3. Run the procedure or user-defined function (see the "Running procedures and user-defined functions" section).
  4. Get the output value from the ParamArray (see the "Getting OUTPUT parameter values" section). You might also want to reset the variable for reuse.

For example, to pass an INPUT-OUTPUT integer parameter that does not support the Unknown value (?), you might do the following:

Passing an INPUT-OUTPUT parameter using the Java OpenAPI
// Define the variable for the input-output parameter 
// Using Integer object because the output value 
//     is always returned as an Object 
Integer CustomerNumber = new Integer(3); 
// Create the ParamArray 
ParamArray parms = new ParamArray(1); 
// Add the input-output parameter to the ParamArray 
parms.addInteger(0, CustomerNumber, ParamArrayMode.INPUT_OUTPUT); 
// Run the procedure 
... 
// Fill from output parameter - must cast from Object 
CustomerNumber = (Integer) parms.getOutputParameter(0); 


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095